package com.zhang.controller;


import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;


@Controller
public class DemoController {

    @RequestMapping("/show1")
    public void show11() {
        show1();
    }

    @RequestMapping("/show2")
    public void show22() throws FileNotFoundException {
        show2();
    }


    public void show1() {
        System.out.println("抛出类型转换异常....");
        Object str = "zhangsan";
        Integer num = (Integer) str;
    }


    public void show2() throws FileNotFoundException {
        System.out.println("文件找不到异常....");
        InputStream in = new FileInputStream("C:/xxx/xxx/xxx.txt");
    }

}



